<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Test</title>
<!--    <link rel="stylesheet" href="/static/build/layui.css" media="all">-->
    <link rel="stylesheet" type="text/css" href="https://www.layuicdn.com/layui/css/layui.css" />
</head>
<body>
<script src="https://www.layuicdn.com/layui/layui.js"></script>

<button type="button" class="layui-btn" id="test1">
    <i class="layui-icon">&#xe67c;</i>上传文件
</button>

<script>
layui.use('upload', function(){
  var upload = layui.upload;

  //执行实例
  var uploadInst = upload.render({
    elem: '#test1' //绑定元素
    ,url: 'http://127.0.0.1:9600/minio/upload' //上传接口
    ,accept: 'file'
    ,done: function(res){
      layer.msg(res.msg);
      //上传完毕回调
    }
    ,error: function(){
      //请求异常回调
    }
  });
});
</script>
</body>
</html>